package com.nuo.backend.modules.security.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.nuo.backend.modules.security.entity.SecCaptchaEntity;

import javax.servlet.http.HttpServletRequest;
import java.awt.image.BufferedImage;

/**
 * 系统验证码
 *
 * @author nuo
 * @email 3033616351@qq.com
 * @date 2022-12-04 01:55:55
 */
public interface SecCaptchaService extends IService<SecCaptchaEntity> {


    /**
     * @description: 获取图片验证码
     * @param request
     * @param uuid
     * @return java.awt.image.BufferedImage
     * @date: 2022/12/18 17:51
     */
    BufferedImage getCaptchaImg(HttpServletRequest request, String uuid);

    /**
     * @description: 获取Base64的图片验证码
     * @param request
     * @param uuid
     * @return java.lang.String
     * @date: 2022/12/18 17:52
     */
    String captchaStr(HttpServletRequest request, String uuid);

    /**
     * 验证码效验
     * @param uuid  uuid
     * @param code  验证码
     * @return  true: 成功  false: 失败
     */
    boolean validate(String uuid, String code);

}

